W10. Singular Value Decomposition
1. Theory
1.1 Introduction and Motivation
Eigenvalue decomposition is one of the most powerful tools in linear algebra, but it has a significant limitation: it applies only to square matrices and, even then, only to diagonalizable ones. Many of the most important matrices in applications — tall data matrices, wide system matrices, rectangular transformations — fall outside this framework entirely. We need a universal factorization that works for any matrix, of any shape and any rank.
There is a second, subtler limitation. Even for symmetric matrices, eigenvalue decomposition gives us a single basis of eigenvectors that simultaneously diagonalizes the matrix in both the domain and the codomain, because for a symmetric matrix
The Spectral Theorem tells us that every real symmetric matrix
Singular Value Decomposition (SVD) is exactly that universal method. It factors any real matrix
1.2 SVD Basics
The fundamental result is:
Theorem (SVD Existence): For every matrix
The columns of
To read this decomposition geometrically: the matrix
1.2.1 Shape of for Different Matrix Sizes
The matrix
- Tall matrix (
): looks like a diagonal block stacked on top of an zero block. There are at most singular values. - Wide matrix (
): looks like a diagonal block followed by an zero block to the right. There are at most singular values. - Square matrix (
): is an diagonal matrix.
In all cases, at most
1.3 Properties of Singular Values
Singular values have several important properties that make them a robust measure of the “size” and “complexity” of a matrix.
Non-negativity and ordering: By convention, singular values are always listed in non-increasing order:
Rank: The rank of
Connection to matrix norms: The largest singular value
Uniqueness: The singular values of
1.4 Computing the SVD
The practical algorithm for computing the SVD relies on a deep connection between
1.4.1 Connection to and
Let
This is exactly the eigendecomposition of
Similarly:
So the columns of
This gives us the key equations:
The right singular vectors
1.4.2 Step-by-Step Algorithm
Given
- Compute
. This is symmetric and positive semi-definite. - Find the eigenvalues
of . These satisfy because is PSD. - Extract singular values:
for , where is the number of positive eigenvalues. - Find unit eigenvectors of
to form the columns of . - Compute left singular vectors:
for . - Extend
: complete to a full orthonormal basis of (use the null space of for the remaining vectors). - Assemble
, , and verify .
1.4.3 Special Cases
Rank-1 matrix: If
Symmetric positive semi-definite matrix: If
1.5 Algebraic Properties of the SVD
Given
Transpose:
Inverse (square, full-rank case): If
This is immediate because
Scalar multiple: For any scalar
The singular values of
1.6 The Four Fundamental Subspaces via SVD
The SVD provides a complete and elegant description of the four fundamental subspaces of a matrix. This is one of the most important applications of the decomposition.
Recall that for
- The column space
has dimension . - The left null space
has dimension . - The row space
has dimension . - The null space
has dimension .
From the SVD
: spanned by the first columns of : . : spanned by the last columns of : . : spanned by the first columns of : . : spanned by the last columns of : .
This is the Fundamental Theorem of Linear Algebra: the four subspaces are organized into two orthogonal pairs:
Why this works:
1.7 SVD as a Sum of Rank-1 Matrices
Expanding the product
Each term
This information hierarchy is the key insight behind low-rank approximation: if we drop the small terms, we get a matrix that is “almost”
1.8 Applications: Low-Rank Approximation, Image Compression, and Denoising
1.8.1 Frobenius Norm and Energy
The Frobenius norm of a matrix
The second equality follows directly from the SVD. The squared Frobenius norm can be thought of as the total energy of the matrix. The fraction of energy captured by the top
This ratio is fundamental in deciding how many terms to keep in a low-rank approximation.
1.8.2 The Eckart–Young Theorem
The rank-
This is obtained by keeping only the top
Theorem (Eckart–Young, 1936): Among all matrices
This theorem guarantees that the SVD rank-
1.8.3 Image Compression
A grayscale image of size
singular values: numbers left singular vectors: numbers right singular vectors: numbers
Total storage cost:
For small
1.8.4 Denoising and PCA
Beyond compression, the SVD is central to Principal Component Analysis (PCA): the right singular vectors
In denoising, we model a noisy matrix as
2. Definitions
- Singular Value Decomposition (SVD): A factorization
of any real matrix , where and are orthogonal matrices and has non-negative entries only on the main diagonal. - Left singular vectors: The columns
of in the SVD; they form an orthonormal basis of . - Right singular vectors: The columns
of in the SVD; they form an orthonormal basis of . - Singular values: The non-negative diagonal entries
of ; they satisfy . - Rank (from SVD): The rank of
equals the number of strictly positive singular values of . - Column space
: The subspace of spanned by the columns of ; in the SVD, spanned by . - Null space
: The subspace of consisting of all with ; in the SVD, spanned by . - Row space
: The column space of ; equivalently, the subspace of spanned by the rows of ; in the SVD, spanned by . - Left null space
: The null space of ; a subspace of ; in the SVD, spanned by . - Frobenius norm:
; a measure of the total “size” of a matrix. - Rank-
approximation: The matrix , obtained by keeping only the largest singular value terms in the SVD expansion. - Eckart–Young theorem: The rank-
approximation is the closest matrix of rank at most to in both the Frobenius norm and the spectral norm; the approximation error is . - Outer product (rank-1 matrix): The matrix
formed from column vectors and ; always has rank at most 1.
3. Formulas
- SVD factorization:
, where , , for , . - Right singular vectors from
: (eigenvectors of ). - Left singular vectors from right:
for . - SVD of transpose:
. - SVD of inverse (square, invertible):
. - SVD of scalar multiple:
; singular values of are . - Rank-1 expansion:
. - Best rank-
approximation (Eckart–Young): . - Frobenius approximation error:
. - Frobenius norm via singular values:
. - Storage cost of rank-
SVD: numbers. - Energy fraction of top
singular values: .
4. Practice
4.1 Compute , Singular Values, and Rank (Lab 8, Task 1)
Let
Click to see the solution
Key Concept: We compute
Step 1 — Compute
Step 2 — Find eigenvalues of
Since
Step 3 — Extract singular values.
The rank equals the number of strictly positive singular values:
Step 4 — Geometric interpretation.
Because rank
Answer:
4.2 Compute the Full SVD (Lab 8, Task 2)
Compute the full SVD of
Click to see the solution
Key Concept: We follow the standard SVD algorithm: compute
Step 1 — Compute
Step 2 — Find eigenvalues of
So
Step 3 — Extract singular values.
Step 4 — Find right singular vectors (columns of
For
Take
For
Step 5 — Compute left singular vectors.
Similarly,
Numerically:
Answer:
4.3 SVD of and ; Effect of Scaling (Lab 8, Task 3)
Using the SVD of
Click to see the solution
Key Concept: The SVD formulas
Throughout,
Part (a) — SVD of
Step 1: Use the transpose formula. If
Step 2: Since
Step 3: Therefore
Part (b) — SVD of
Step 1: Since
Step 2: Use the inverse formula:
The singular values of
Part (c) — Effect of replacing
Step 1: Use the scalar multiple formula:
Step 2: The matrices
Answer: (a)
4.4 Full SVD and Four Fundamental Subspaces (Lab 8, Task 4)
Let
Click to see the solution
Key Concept: Column 2 of
Step 1 — Compute
Step 2 — Find eigenvalues of
So
Step 3 — Extract singular values.
Step 4 — Find right singular vectors (columns of
For
For
Step 5 — Compute left singular vectors.
For
Step 6 — Assemble SVD.
Step 7 — Four fundamental subspaces.
Answer:
4.5 SVD of a Symmetric PSD Matrix (Lab 8, Task 5)
Let
Click to see the solution
Key Concept: For a symmetric positive semi-definite (PSD) matrix, the eigendecomposition
Step 1 — Eigendecomposition.
Let
Step 2 — Write the SVD.
Comparing with
Step 3 — Rank.
The number of non-zero singular values is 2, so
Step 4 — Four fundamental subspaces.
Since
(dimension 2) (dimension 1)
Step 5 — Why this case is simpler.
In the general SVD algorithm, we must: (i) compute
Answer: SVD is
4.6 Best Rank-1 and Rank-2 Approximations (Lab 8, Task 6)
Suppose
Click to see the solution
Key Concept: By the Eckart–Young theorem, the best rank-
The singular values are
Step 1 — Best rank-1 approximation
Keep only the term with the largest singular value:
Step 2 — Best rank-2 approximation
Keep the two largest terms:
Step 3 — Frobenius error
By Eckart–Young, the discarded singular values are
Step 4 — Frobenius error
Only
Step 5 — Interpretation.
The rank-1 approximation retains
Answer:
4.7 Energy Retention and Storage Comparison (Lab 8, Task 7)
A matrix
Click to see the solution
Key Concept: The energy fraction captured by the top
Step 1 — Compute total energy.
Step 2 — Check
Step 3 — Check
The smallest
Step 4 — Compare storage costs.
- Full matrix:
numbers. - Rank-2 SVD: we store
left singular vectors ( numbers), right singular vectors ( numbers), and singular values ( numbers). Total: numbers. - Compression ratio:
.
The rank-2 SVD requires less than
Step 5 — Other applications of this technique.
Beyond image compression, this approach is used in: recommendation systems (matrix factorization for collaborative filtering), natural language processing (latent semantic analysis), network analysis (compressing adjacency matrices), and any machine learning pipeline where the data matrix has low effective rank.
Answer:
4.8 Full SVD and Best Rank-1 Approximation (Lab 8, Task 8)
Let
Click to see the solution
Key Concept: For a
Step 1 — Compute
Step 2 — Find eigenvalues of
Eigenvalues:
Step 3 — Find right singular vectors (columns of
For
For
For
Step 4 — Compute left singular vectors.
Step 5 — Assemble SVD.
Step 6 — Four fundamental subspaces.
(full, dimension 2) (dimension 0, since ) (dimension 2) (dimension 1)
Step 7 — Best rank-1 approximation.
Answer:
4.9 Singular Values and Rank for Three Matrices (Assignment 8, Problem 1)
Compute the singular values and determine the rank of each of the following matrices: (a)
Click to see the solution
Key Concept: The singular values of
Part (a) —
Step 1:
Step 2:
Step 3: Both singular values are positive, so
Part (b) —
Step 1: Observe that row 2
Step 2:
Step 3:
Step 4:
Part (c) —
Step 1:
Step 2:
Answer: (a)
4.10 Full SVD of a Matrix (Assignment 8, Problem 2)
Compute the full SVD of
Click to see the solution
Key Concept:
Step 1 — Compute
Step 2 — Eigenvalues and singular values.
Step 3 — Right singular vectors (columns of
Eigenvector for
Step 4 — Left singular vectors.
Step 5 — Extend
We need
Step 6 — Assemble and verify.
Verification:
Answer:
4.11 Reduced SVD of a Tall Matrix (Assignment 8, Problem 3)
Compute the reduced (thin) SVD of
Click to see the solution
Key Concept: The reduced (thin) SVD keeps only the
Step 1 — Compute
Step 2 — Eigenvalues and singular values.
Step 3 — Right singular vectors (columns of
Eigenvector for
Step 4 — Left singular vectors (columns of
Step 5 — Assemble reduced SVD.
Verification:
Answer: Reduced SVD:
4.12 SVD of a Rank-Deficient Matrix (Assignment 8, Problem 4)
Find the singular values, rank, and full SVD of
Click to see the solution
Key Concept: Both rows of
Step 1 — Compute
Step 2 — Eigenvalues and singular values.
Step 3 — Right singular vectors.
For
For
Step 4 — Left singular vectors.
For
Step 5 — Assemble and verify.
Verification:
Answer:
4.13 SVD of a Wide Matrix (Assignment 8, Problem 5)
Find the singular values, rank, and full SVD of
Click to see the solution
Key Concept:
Step 1 — Compute
Step 2 — Eigenvalues and singular values.
Step 3 — Right singular vectors (columns of
Eigenvectors of
Step 4 — Left singular vectors.
Step 5 — Assemble SVD.
Verification:
Answer:
4.14 True/False: SVD Properties (Assignment 8, Problem 6)
Determine whether each statement is true or false. Justify your answer.
Every square matrix has a unique SVD.
The singular values of
are always non-negative.If
is symmetric positive definite, then its singular values equal its eigenvalues.The rank of a matrix equals the number of non-zero singular values.
Click to see the solution
Key Concept: These questions test the core properties of singular values and the SVD. Remember: singular values are unique, but singular vectors (and hence the full factorization
Part (a) — “Every square matrix has a unique SVD.” — FALSE.
Step 1: Every matrix (square or not) does have an SVD, so existence is true.
Step 2: However, uniqueness fails. The singular values
Conclusion: The SVD exists for every matrix but is not unique in general.
Part (b) — “The singular values of
Step 1: Singular values are defined as
Step 2: The matrix
Step 3: The square root of a non-negative number is non-negative, so
Part (c) — “If
Step 1: If
Step 2: For a symmetric matrix,
Step 3: Therefore
Conclusion: The singular values and eigenvalues coincide for symmetric positive definite matrices.
Part (d) — “The rank of a matrix equals the number of non-zero singular values.” — TRUE.
Step 1: The rank of
Step 2: Formally:
Answer: (a) False — singular values are unique but singular vectors are not, so the full SVD factorization is not unique. (b) True — singular values are square roots of eigenvalues of the PSD matrix
4.15 SVD of a Symmetric Matrix (Assignment 8, Problem 7)
Compute the SVD of
Click to see the solution
Key Concept:
Step 1 — Compute
Since
Step 2 — Eigenvalues of
So
Step 3 — Singular values.
Step 4 — Eigenvectors of
For
For
Step 5 — Verify using
Step 6 — Assemble SVD.
Verification:
Answer:
4.16 Rank and SVD from Known Singular Values (Assignment 8, Problem 8)
A matrix
Click to see the solution
Key Concept: Given the SVD
Part (a) — Rank of
Step 1: The rank of
Step 2: We have
Part (b) — SVD of
Step 1: If
Step 2:
Step 3: Therefore
Step 4: The singular values of
Part (c) — Singular values of
Step 1: Use the scalar multiple formula:
Step 2:
Answer: (a) Rank
4.17 Compute and SVD for a Nilpotent Matrix (Assignment 8, Problem 9)
Let
Click to see the solution
Key Concept:
Step 1 — Compute
Step 2 — Eigenvalues and singular values.
Note:
Step 3 — Right singular vectors (columns of
Eigenvector of
Eigenvector for
Step 4 — Left singular vectors.
For
Step 5 — Assemble and verify.
Verification:
Answer:
4.18 SVD of a Diagonal Matrix (Tutorial 8, Example 1)
Compute the full SVD of
Click to see the solution
Key Concept: For a diagonal matrix,
Step 1 — Compute
Step 2 — Find eigenvalues of
Since
We list them in decreasing order:
Step 3 — Extract singular values.
So
Step 4 — Find right singular vectors (columns of
The eigenvector corresponding to
Note:
Step 5 — Compute left singular vectors.
Step 6 — Assemble and verify.
Verification:
Answer:
4.19 Rank and Subspace Dimensions from Singular Values (Tutorial 8, Example 2)
A matrix
Click to see the solution
Key Concept: The rank equals the number of non-zero singular values. The dimensions of all four fundamental subspaces follow from the rank-nullity theorem.
Step 1 — Determine the rank.
There are three non-zero singular values (
Step 2 — Find subspace dimensions.
The matrix is
(column space, subspace of ): . (left null space, subspace of ): . (row space, subspace of ): . (null space, subspace of ): .
Interpretation: The SVD provides explicit orthonormal bases for all four subspaces:
Answer: Rank
4.20 SVD of a Rank-1 Matrix (Tutorial 8, Example 3)
Compute the SVD of
Click to see the solution
Key Concept: This matrix has rank 1 because each row is a scalar multiple of
Step 1 — Compute
Step 2 — Find eigenvalues of
So
Step 3 — Extract singular values.
Only one non-zero singular value, confirming rank 1.
Step 4 — Find right singular vectors.
For
For
(Check:
Step 5 — Compute the first left singular vector.
Step 6 — Extend
We need
(These form an orthonormal set together with
Step 7 — Assemble the SVD.
Answer:
4.21 Four Fundamental Subspaces from SVD (Tutorial 8, Example 4)
A
Click to see the solution
Key Concept: Given the SVD, the four fundamental subspaces are read directly from the singular vectors and the rank. No further computation is needed.
Step 1 — Determine the rank.
The diagonal of
Step 2 — Read off the four fundamental subspaces.
The matrix is
- Column space
, : Spanned by — the left singular vectors corresponding to the non-zero singular values. - Left null space
, : Spanned by — the left singular vector corresponding to . - Row space
, : Spanned by — the right singular vectors corresponding to the non-zero singular values. - Null space
, : Spanned by — the right singular vectors corresponding to the zero singular values.
Verification of dimensions:
Orthogonality:
Answer:
4.22 SVD as a Sum of Rank-1 Matrices (Tutorial 8, Example 5)
Compute the full SVD of
Click to see the solution
Key Concept: Once we have the SVD, the rank-1 expansion
Step 1 — Compute
Step 2 — Eigenvalues and singular values.
Both are positive, so rank
Step 3 — Right singular vectors.
Step 4 — Left singular vectors.
Extend
Step 5 — Write the SVD.
Step 6 — Rank-1 expansion.
Answer:
4.23 Prove the Eigenvalue Connection (Tutorial 8, Example 6)
Let
Click to see the solution
Key Concept: This proof directly establishes the connection between SVD and eigendecomposition, showing why
Step 1 — Expand
Using the property
Therefore:
Step 2 — Simplify using
Since
Step 3 — Interpret as eigendecomposition.
The matrix
The expression
Conclusion: The eigenvalues of
Answer:
4.24 Image Compression via SVD (Tutorial 8, Example 7)
A grayscale image is represented as a matrix
Click to see the solution
Key Concept: The rank-
Step 1 — Full matrix storage.
Step 2 — Rank-3 approximation storage.
For
Breaking this down:
- Singular values:
numbers - Left singular vectors:
numbers - Right singular vectors:
numbers - Total:
numbers ✓
Step 3 — Compression ratio.
The rank-3 approximation uses only about
Answer: Full storage: